/*
package com.atguigu.srb.oss.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.common.auth.CredentialsProviderFactory;
import com.aliyun.oss.common.auth.EnvironmentVariableCredentialsProvider;
import com.aliyuncs.exceptions.ClientException;
import com.atguigu.srb.common.exception.BusinessException;
import com.atguigu.srb.common.result.ResponseEnum;
import com.atguigu.srb.oss.utils.OssProperties;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

*/
/**
 * @Description:
 * @Author: Gavin
 * @Date: 7/7/2023 4:33 PM
 *//*

//该配置类主要是用来提前准备好我们的OssClient客户端的,方便在方法中调用
@Configuration
@Slf4j
@Order(2)
//指定当前组件类初始化之前必须创建OssProperties对象注入到容器中
// @EnableConfigurationProperties(OssProperties.class)
public class OssConfiguration {

    @Bean
    public OSS getOssClient(){
        //从系统的环境变量里面获取access ID和access sevret用来创建凭证
        try {
            EnvironmentVariableCredentialsProvider credentialsProvider = CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();
            //创建ossClient的实例
            OSS ossClient = new OSSClientBuilder().build(OssProperties.ENDPOINT*/
/* "oss-cn-shanghai.aliyuncs.com" *//*
,credentialsProvider);
            return ossClient;
        } catch (ClientException e) {
            //打印异常的堆栈信息
            log.error(ExceptionUtils.getStackTrace(e));
            //抛出我们的自定义的异常
            throw new BusinessException(ResponseEnum.WEIXIN_FETCH_ACCESSTOKEN_ERROR);
        }
    }
}
*/
